import request from '@/utils/request'

export function getDepartmentList(params) {
  return request({
    url: '/system/department/list',
    method: 'get',
    params
  })
}

export function getDepartmentDetail(id) {
  return request({
    url: `/system/department/${id}`,
    method: 'get'
  })
}

export function createDepartment(data) {
  return request({
    url: '/system/department',
    method: 'post',
    data
  })
}

export function updateDepartment(data) {
  return request({
    url: `/system/department/${data.id}`,
    method: 'put',
    data
  })
}

export function deleteDepartment(id) {
  return request({
    url: `/system/department/${id}`,
    method: 'delete'
  })
}